package com.test.demo.view;

import android.content.Context;
import android.util.AttributeSet;
import android.view.View;

import com.test.demo.R;

import cn.jzvd.JzvdStd;


/**
 * @author
 * @version 1.0.0
 * @projectName
 * @description: 饺子播放器
 * @date : 2024/1/5 16:04
 */
public class CustomJZVideo extends JzvdStd {


    public CustomJZVideo(Context context) {
        super(context);
    }

    public CustomJZVideo(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    @Override
    public int getLayoutId() {
        return  R.layout.jz_layout_std;
    }

    @Override
    public void init(Context context) {
        super.init(context);
         findViewById(R.id.fullscreen).setVisibility(View.GONE);
    }

    @Override
    public void onPrepared() {
        super.onPrepared();
        if (screen == SCREEN_FULLSCREEN) {
            mediaInterface.setVolume(1f, 1f);
        } else {
            mediaInterface.setVolume(0f, 0f);
        }
    }

    /**
     * 进入全屏模式的时候关闭静音模式
     */
    @Override
    public void gotoFullscreen() {
        super.gotoFullscreen();
    }

    @Override
    public void setScreenFullscreen() {
        super.setScreenFullscreen();
        if (mediaInterface != null)
            mediaInterface.setVolume(1f, 1f);
    }

    @Override
    public void setScreenNormal() {
        super.setScreenNormal();
        if (mediaInterface != null)
            mediaInterface.setVolume(0f, 0f);
    }



}
